package start;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test03 {
    public Test03() {
        ApplicationContext context = new ClassPathXmlApplicationContext("META-INF\\beans.xml");
        SpitterDAO spitterDao = (SpitterDAO) context.getBean("spitterDao");
        spitterDao.addSpitter((Spitter) context.getBean("spitter"));
        Spitter spitterFromDB = spitterDao.getSpitterById(7);
        System.out.println(spitterFromDB);
        Spitter newSpitter = new Spitter();
        newSpitter.setId(123);
        newSpitter.setUsername("YULYA");
        newSpitter.setPassword("iam2348");
        newSpitter.setFullName("Demyash");
        spitterDao.addSpitterNamedParam(newSpitter);
    }
}
